/*
 * @Author: likang xie 
 * @Date: 2018-06-13 15:56:26 
 * @Purpose: 需要复制功能的页面引入该脚本,按钮类名copy-btn,标签属性data-copy-content
 */

// 使用jquery模块
layui.use('jquery', function () {
  var $ = layui.$;

  var clipboard = new ClipboardJS('.copy-btn', {
    text: function text(e) {
      var c = $(e).data('copy-content');
      console.log($(e))
      if (c == '' || c == '无') return false;
      return $(e).data('copy-content');
    }
  });

  clipboard.on('success', function (e) {
    btgo.msg('已复制');
  });
});